#ifndef LIST_H_
#define LIST_H

#include <stdbool.h>

#define TSIZE 41

struct film {
    char title[TSIZE];
    int rating;
};


//typedef struct film Item;
typedef int Item;

typedef struct node {
    Item item;
    struct node * next;
    struct node * prev;
} Node;

//simple list
//typedef struct Node * List

//better list
typedef struct list {
    Node * head;
    Node * tail;
    unsigned size;
} List;

typedef void (* ListItemCall)(const Item *);


//函数原型

void InitializeList(List *);

bool ListIsEmpty(const List *);

bool ListIsFull();

unsigned ListItemCount(const List *);

bool AddItem(Item item, List *);

void Traverse(const List *, ListItemCall);
void TraverseReverse(const List *, ListItemCall);

void EmptyTheList(List *);

#endif
